package xyz.hubery.model;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import xyz.hubery.enums.CodeEnum;

import java.io.Serializable;

/**
 * 业务异常类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BusException extends RuntimeException  implements Serializable {

    private Integer code;
    private String msg;

    public BusException(CodeEnum codeEnum){
        this.code = codeEnum.getCode();
        this.msg = codeEnum.getMessage();
    }

}
